from pynput.keyboard import Key, Controller
import time

# 准备演奏
# 控制键盘
keyboard = Controller()
# 切换到jQuery键盘钢琴网页
keyboard.press(Key.cmd)
time.sleep(1)
keyboard.press('d')
keyboard.release('d')
keyboard.release(Key.cmd)
#弹起upupoo音乐频谱
keyboard.press(Key.cmd)
keyboard.release(Key.cmd)
time.sleep(1)
keyboard.press(Key.cmd)
keyboard.release(Key.cmd)
time.sleep(2)
#
for n in "LJ LI jIH-HGFGHG HIJ-LJ LP ONO-HGFGHGHih-LMNO NONMLML--HIJK JKLHIj--LMNO NONPOQL--HIJK JKJIHGH--LMNO NOPONML--HIJK JKLHHML--LMNO NONPOQL--HIJK JKJihgh":
    if n != " ":
        if n.islower():
            keyboard.press(n)
            time.sleep(0.8)
            keyboard.release(n)
        else:
            keyboard.press(n.lower())
            time.sleep(0.45)
            keyboard.release(n.lower())
    elif n == '-':
        time.sleep(4)
    else:
        time.sleep(0.2)
